package com.sds.sweng.swat.miplatform.ui.design.utils;

import java.io.UnsupportedEncodingException;

public class KoreanUtils {

	public static int getLength(String text) {
		try {
			return (text.getBytes("euc-kr").length/2) + (text.getBytes("euc-kr").length%2);
		} catch (UnsupportedEncodingException e) {
			return (text.getBytes().length/2) + (text.getBytes().length%2);
		}
	}

	public static int getLength(String text, String charsetName) {
		try {
			return (text.getBytes(charsetName).length/2) + (text.getBytes(charsetName).length%2);
		} catch (UnsupportedEncodingException e) {
			return (text.getBytes().length/2) + (text.getBytes().length%2);
		}
	}

}
